﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>客户报表管理</title>
    <#--引入的一些核心文件-->
    <#include "../common/link.ftl">
    <script>
        $(function () {
            /*时间插件设置*/
            $('.input-daterange').datepicker({
                language: "zh-CN",
                autoclose: true,
                todayHighlight: true,
                clearBtn: true
            });

           $('.chart_btn').click(function () {
               //模态框只能加载一次,打开时先清空之前的
               $('#myModal').removeData('bs.modal');
               var url = $(this).data('url');
               $('#myModal').modal({
                   remote : url + "?" + $('#searchForm').serialize()
               });
               $('#myModal').modal('show');
           })

        })
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../common/navbar.ftl">
    <#assign currentMenu="customerReport">
    <#include "../common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>潜在客户管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <form class="form-inline" id="searchForm" action="/customerReport/list.do" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <div class="form-group">
                        <label for="keyword">关键字:</label>
                        <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}" placeholder="请输入销售姓名">
                    </div>
                     <#--通过时间段查询-->
                    <div class="form-group">
                        <label>时间段查询:</label>
                        <div class="input-daterange input-group" id="datepicker">
                            <input type="text" class="input-sm form-control" name="beginDate"
                                   value="${(qo.beginDate?string('yyyy-MM-dd'))!}" />
                            <span class="input-group-addon">to</span>
                            <input type="text" class="input-sm form-control" name="endDate"
                                   value="${(qo.endDate?string('yyyy-MM-dd'))!}" />
                        </div>
                    </div>
                    <#--通过分组类型查询-->
                    <div class="form-group">
                        <label for="status">分组类型:</label>
                        <select class="form-control" id="groupType" name="groupType">
                            <option value="e.name">员工</option>
                            <option value="DATE_FORMAT(c.input_time, '%Y')">年</option>
                            <option value="DATE_FORMAT(c.input_time, '%Y-%m')">月</option>
                            <option value="DATE_FORMAT(c.input_time, '%Y-%m-%d')">日</option>
                        </select>
                        <script>
                            $("#groupType").val("${qo.groupType!}")
                        </script>
                    </div>
                    <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> 查询</button>
                </form>
                <button type="button" class="btn btn-info chart_btn" data-url="/customerReport/listBar.do">
                    <span class="glyphicon glyphicon-stats"></span> 柱状图
                </button>
                <button type="button" class="btn btn-warning chart_btn" data-url="/customerReport/listPie.do">
                    <span class="glyphicon glyphicon-dashboard"></span> 饼状图
                </button>
                <!--编写内容-->
                <div class="box-body table-responsive no-padding ">
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th id="th"></th>
                            <th>潜在客户新增数</th>
                        </tr>
                        <script>
                            $('#th').text("分组类型:"+$('#groupType option:selected').text())
                        </script>
                        <#list result.list as customerReport>
                            <tr>
                                <#--取值后面加个感叹号可以解决空指针问题,也可以感叹后加个默认值-->
                                <td>${(customerReport.groupType)!}</td>
                                <td>${(customerReport.number)!}</td>
                            </tr>
                        </#list>
                    </table>
                    <!--分页-->
                    <#include "../common/page.ftl">
                </div>
            </div>
        </section>
    </div>
        <#--引入主页面的底部(一些公司的信息)-->
    <#include "../common/footer.ftl">
</div>

<#--模态框-->
<div class="modal fade" id="myModal">
    <div class="modal-dialog">
        <div class="modal-content">


        </div>
    </div>
</div>
</body>
</html>
